#  coding:utf-8
"""
动态相关测试用例配置
"""
__author__ = 'jiaoshupeng'
from ..parameters.ia_configure import account_live
from conf_public import topic_name_lock
uid = account_live[2]
# vice_uid = account_vice[2]


# 定义模块
model_person = '个人主页'
model_tk = '动态相关'

# 接口定义
intef_users = '/ticktocks/users/'
#  intef_person = '/users/%s'%uid
intef_ticktock = '%s%s/timeline?gmt=28800&page=1&size=20'%(intef_users, uid)
intef_follows = '%s%s?filter=follows&gmt=28800&page=1'%(intef_users, uid)
intef_follows_2 = '%s%s?filter=follows&gmt=28800&page=2'%(intef_users, uid)
intef_hot = '%s%s?filter=hot&gmt=28800&page=1'%(intef_users, uid)
intef_hot_2 = '%s%s?filter=hot&gmt=28800&page=2'%(intef_users, uid)
intef_nearby = '%s%s?filter=nearby&gmt=28800&lat=39.89995198567708&lot=116.47044921875&page=1'%(intef_users, uid)
intef_nearby_2 = '%s%s?filter=nearby&gmt=28800&lat=39.89995198567708&lot=116.47044921875&page=2'%(intef_users, uid)
intef_tp='/ticktocks/topics/hot?filter=list&page=1&size=20'
intef_topic_lock = '/ticktocks/topics?name=%s&filter=hot&page=1&size=20'%topic_name_lock
intef_tp_hot = '/ticktocks/topics?name=GG&filter=hot&page=1&size=20'
intef_nl = '/ticktocks/users/%s/information?filter=comments&isoffset=1&offset=0&size=20'%uid
intef_inf_liked = '/ticktocks/users/%s/information/count?filter=liked'%uid
intef_inf_like_list = '/ticktocks/users/%s/information?filter=liked&isoffset=1&offset=0&size=20'%uid
intef_me = '/ticktocks/me'
intef_like = '/ticktocks/%s/liked/%s?is_ads=0'
intef_comment = '/ticktocks/%s/comments'
intef_like_list = '/ticktocks/%s/liked?is_ads=0&page=1&size=40'
intef_like_del = '/ticktocks/%s/liked/%s?http_method_override=DELETE&is_ads=0'
intef_tit_del = '/ticktocks/%s?http_method_override=DELETE'
intef_comment_deltail = '/ticktocks/%s/comments?is_ads=0&gmt=28800&page=1' # 查看动态详情





# post数据
allow_comments = 2
ticktocks_send_text = '这是测试数据, 审核同学不要给审核通过呦, 谢啦'
ticktocks_send_data = {"phone":"iPhone", "os":"ios9.3.1", "send":"1",
                       "allow_comments":allow_comments, "text":ticktocks_send_text,
                       "lot":"116.4704760742188", "lat":"39.89992024739583", "gmt":"28800"}
ticktocks_send_data_unlegal = {"phone":"iPhone", "os":"ios9.3.1", "send":"1",
                       "allow_comments":allow_comments, "text":"操你妈",
                       "lot":"116.4704760742188", "lat":"39.89992024739583", "gmt":"28800"}
ticktocks_send_comment = {"text":"哈哈哈", "reply_id":"", "is_reply":"0", "gmt":"111000010000000"}
# 发布仅粉丝可评论的动态
ticktocks_data_onlyfans = {"phone":"iPhone", "os":"ios9.3.1", "send":"1",
                       "allow_comments":3, "text":"这是测试数据, 审核同学不要给审核通过呦, 谢啦# QA#  # BluedQA# ",
                       "lot":"116.4704760742188", "lat":"39.89992024739583", "gmt":"28800"}
ticktocks_send_comment_unlegal = {"gmt":"28800", "text":"操你妈"}
ticktocks_post = {}

# 写case
#  case_info_person = [intef_person,  model_person, '个人主页加载个人信息']
case_info_ticktock = [intef_ticktock, model_tk, '个人主页加载个人动态信息']
case_info_send_detail = [intef_me, model_tk, '发送动态(allow_comments=%s text=%s)'%(allow_comments, ticktocks_send_text)]
case_send_unlegal = [intef_me, model_tk, '发送不合法的动态, 提示动态内容不合法']
case_send_onlyfans = [intef_me, model_tk, '发布仅粉丝可评论的动态']
case_info_like_data = [intef_like, model_tk, '创建动态点赞']
case_intef_follows = [intef_follows, '动态相关', '动态关注第一页']
case_intef_follows_page2 = [intef_follows_2, '动态相关', '动态关注第二页']
case_intef_hot = [intef_hot, '动态相关', '动态热门第一页']
case_intef_hot_page2 = [intef_hot_2, '动态相关', '动态热门第二页']
case_intef_nearby = [intef_nearby, '动态相关', '动态附近第一页']
case_intef_nearby_page2 = [intef_nearby_2, '动态相关', '动态附近第一页']
case_topic_hot = [intef_tp, '动态相关', '热门话题列表', '']
case_topic_locked = [intef_topic_lock, '动态相关', '查看被锁定的动态话题,提示话题被锁定']
case_topic_hot_detail = [intef_tp_hot, '动态相关', '名称为GG的话题详情']
case_dynamic_news_list = [intef_nl, '动态相关', '动态消息列表']
case_intef_comment = [intef_comment,  '动态相关', '动态评论']
case_comment_onlyfans = [intef_comment,  '动态评论', '评论没有权限的动态,非粉丝用户评论时提示由于用户设置您无法评论']
case_intef_comment_unlegal = [intef_comment,  '动态相关', '动态评论不合法内容, 提示评论内容不合法']
case_intef_like_list = [intef_like_list,  '动态相关',  '点赞列表']
case_info_like_del = [intef_like_del, '动态相关', '创建取消点赞']
case_info_tit_del = [intef_tit_del, '动态相关', '删除动态']
case_comment_detail = [intef_comment_deltail, '查看动态', '查看已删除的动态,提示动态已删除或者被屏蔽']
case_intef_inf_liked = [intef_inf_liked, '动态通知', '动态通知赞过我的']
case_intef_inf_like_list = [intef_inf_like_list, '动态通知', '动态通知赞列表']

# 校验数据
# 填写校验数据格式如下
#  {
#      "code": 200,
#      "message": "",
#      "extra": [
#          {
#              "comment_id": "1356453",
#              "comment_uid": "600497",
#              "feed_id": "969409",
#              "feed_uid": "600497",
#          }
#      ],
#      "request_id": "-",
#      "request_time": 1396359886.8578,
#      "response_time": 1396359886.9115
#  }
# 参数说明:  校验数据必须为列表, 列表有两部分, 列表第一个数据为要校验的数据在哪条数据下, 如在最外层, 填写为'', 第二个参数为字典如校验code, 格式为['', {'code':200}]
# 校验data下comment_id, comment_uid, 格式为['data', ['comment_id', "comment_uid"]]
# 校验数据code=200
ticktocks_code = [
    ['self', '', {'code':200}],
]
# 动态已经被删除或屏蔽了
ticktocks_code_404100 = [
    ['self', '', {'code':404100}],
]
# 发送动态校验数据
ticktocks_dj_send_tick = [
    ['self', 'extra', {'allow_comments':allow_comments, 'feed_content':ticktocks_send_text}]
]
# 校验动态不合法
ticktocks_code_4031003 = [
    ['self', '', {'code':4031003}],
]
# 评论不合法
ticktocks_code_4031005 = [
    ['self', '', {'code':4031005}],
]
# 话题已被锁定
ticktocks_code_403110 = [
    ['self', '', {'code':403110}],
]
# 由于用户限制,您无法评论
ticktocks_code_403111 = [
    ['self', '', {'code':403111}]
]
# 评论校验数据
ticktock_dj_comment = [
    ['self', 'data', {'comment_content':'哈哈哈'}]
]

# 配置URL参数
# 点赞参数
url_like_data = [
    ['ticktocks_send_detail', 'extra', ['feed_uid', 'feed_id']]
]
# 评论参数
url_comment = [
    ['ticktocks_send_detail', 'data', ['feed_id']]
]
url_comment_onlyfans = [
    ['ticktocks_send_onlyfans', 'data', ['feed_id']]
]